namespace DotNetNuke.Services.Wizards
{
    using System;

    /// -----------------------------------------------------------------------------
    /// <summary>
    /// The WizardEventArgs class extends EventArgs to provide Wizard specific
    /// Properties.
    /// </summary>
    /// <remarks>
    /// </remarks>
    /// <history>
    /// [cnurse]	10/10/2004	created
    /// </history>
    /// -----------------------------------------------------------------------------
    public class WizardEventArgs : EventArgs
    {
        private int m_CurPageNo;
        private WizardPageCollection m_Pages;
        private int m_PrevPageNo;

        /// -----------------------------------------------------------------------------
        /// <summary>
        /// Constructs a default WizardEventArgs object
        /// </summary>
        /// <remarks>
        /// </remarks>
        /// <history>
        /// [cnurse]	10/10/2004	created
        /// </history>
        /// -----------------------------------------------------------------------------
        public WizardEventArgs() : this(-1, -1, null)
        {
        }

        /// -----------------------------------------------------------------------------
        /// <summary>
        /// Constructs a custom WizardEventArgs object
        /// </summary>
        /// <remarks>
        /// </remarks>
        /// <param name="pageNo">The Page No where the Event happened</param>
        /// <param name="pages">The WizardPageCollection</param>
        /// <history>
        /// [cnurse]	10/10/2004	created
        /// </history>
        /// -----------------------------------------------------------------------------
        public WizardEventArgs(int pageNo, WizardPageCollection pages)
        {
            this.m_CurPageNo = 0;
            this.m_PrevPageNo = -1;
            this.m_CurPageNo = pageNo;
            this.m_PrevPageNo = pageNo;
            this.m_Pages = pages;
        }

        /// -----------------------------------------------------------------------------
        /// <summary>
        /// Constructs a custom WizardEventArgs object
        /// </summary>
        /// <remarks>
        /// </remarks>
        /// <param name="pageNo">The Page No where the Event happened</param>
        /// <param name="prevNo">The Page No where the Event happened</param>
        /// <param name="pages">The WizardPageCollection</param>
        /// <history>
        /// [cnurse]	10/10/2004	created
        /// </history>
        /// -----------------------------------------------------------------------------
        public WizardEventArgs(int pageNo, int prevNo, WizardPageCollection pages)
        {
            this.m_CurPageNo = 0;
            this.m_PrevPageNo = -1;
            this.m_CurPageNo = pageNo;
            this.m_PrevPageNo = prevNo;
            this.m_Pages = pages;
        }

        public WizardPage Page
        {
            get
            {
                WizardPage retValue = null;
                if (this.m_CurPageNo > -1)
                {
                    retValue = this.m_Pages[this.m_CurPageNo];
                }
                return retValue;
            }
        }

        public int PageNo
        {
            get
            {
                return this.m_CurPageNo;
            }
        }

        public WizardPage PreviousPage
        {
            get
            {
                WizardPage retValue = null;
                if (this.m_PrevPageNo > -1)
                {
                    retValue = this.m_Pages[this.m_PrevPageNo];
                }
                return retValue;
            }
        }

        public int PreviousPageNo
        {
            get
            {
                return this.m_PrevPageNo;
            }
        }
    }
}

